// app.js
import http from './utils/http'
wx.$http = http

App({
  // 全局变量   名字可以自定义
  globalDate: {
    isMusicPlay: false,
    globamusicId: '',
  },
  // onLaunch() {
  //   // 展示本地存储能力
  //   const logs = wx.getStorageSync('logs') || []
  //   logs.unshift(Date.now())
  //   wx.setStorageSync('logs', logs)
  // },
  // globalData: {
  //   userInfo: null
  // }
  // 淡出动画 (that:this, param:动画名称, opacity:属性值)
  fadeout_show(that, param, opacity) {
    var animation = wx.createAnimation({
      //持续时间800ms
      duration: 800,
      timingFunction: 'linear',
    })
    animation.opacity(opacity).step()
    //将param转换为key
    var json = '{"' + param + '":""}'
    json = JSON.parse(json)
    json[param] = animation.export()
    //设置动画
    that.setData(json)
  },
})
